<template>
  <div class="app-container">
    <basic-table
      :table-title="tableTitle"
      :data-source="dataSource"
      :data-params="dataParams"
      :multiple-table="false"
      class="mt-4"
    >
      <template v-slot:project="scope">
        <div v-if="scope.row.Id !==null">
          <router-link :to="{path: '/project/waterInfo?id=' + scope.row.Id}">
          <span style="color: #0087FE">{{ scope.row.ProjectName }}</span>
        </router-link>
        </div>
        <div v-else>
          <span>{{ scope.row.ProjectName }}</span>
        </div>
       
      </template>
    </basic-table>
  </div>
</template>
<script>
import BasicTable from '@/components/BasicTable/index.vue'
import { getPerShuiLiProjects } from '@/api/person'
export default {
  name: 'water',
  components: { BasicTable },
  props: {
    personId: { type: String, default: '' }
  },
  data() {
    return {
      dataSource: () => getPerShuiLiProjects,
      dataParams: {
        personId: ''
      },
      tableTitle: [
      {
          label: '项目类别',
          value: 'ProjectType',
          show: true,
          type: 'text'
        },
        {
          label: '项目编码',
          value: 'ProjectCode',
          show: true,
          type: 'text'
        },
        {
          label: '项目名称',
          value: 'ProjectName',
          show: true,
          type: 'slot',
          slot: 'project'
        },
        {
          label: '项目属地',
          value: 'DistFullName',
          show: true,
          type: 'text'
        },
       
        {
          label: '建设单位',
          value: 'BuildCompanyName',
          show: true,
          type: 'text'
        }
      ]
    }
  },
  created() {
    this.dataParams.personId = this.personId
  }
}
</script>
